(ns redis-manager.core
  (:require [taoensso.carmine :as car :refer (wcar)])
  (:gen-class))

(def server1-conn {:pool {} :spec {:host "localhost" :port 6379 :password "xxxxxx"}})
(defmacro wcar* [& body] `(car/wcar server1-conn ~@body))
(defmacro redis-eval [& body] `(car/wcar server1-conn (car/eval* ~@body)))

(comment (wcar* (car/ping)))
(comment (wcar* (key "*sceneryCountCountyLvl.action*")))
(comment (redis-eval "for _,k in ipairs(redis.call('keys', ARGV[1])) do redis.call('del', k) end" 0 wildcard))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (println "Hello, World!"))
